/*
 * Project Name: cms_manager
 * File Name: PictureService.java
 * Copyright: ZKTeco Corporation 2015
 * Description: TODO 请在此处添加对本文件的描述
 * Creator: Administrator
 * Create Date: 2015年3月17日 下午6:03:06
 */
package com.shishuo.cms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shishuo.cms.dao.PictureDao;
import com.shishuo.cms.entity.PictureEntity;
import com.shishuo.cms.entity.vo.PageVo;
import com.shishuo.cms.vo.ArticleEntityVo;
import com.shishuo.cms.vo.VideoEntityVo;

/**
 * 
 * @since 2015年3月17日 下午6:03:06
 */
@Service
public class PictureService  extends BaseService<PictureEntity, Long>
{
	private PictureDao pictureDao;

	@Autowired
	public void setPictureDao(PictureDao pictureDao)
	{
		super.setBaseDao(pictureDao);
		this.pictureDao = pictureDao;
	}
	public PageVo<PictureEntity> getAllListPage(int pageNum) throws Exception{
		PageVo<PictureEntity> pageVo = new PageVo<PictureEntity>(pageNum);
		List<PictureEntity> list = this
				.getAllList(pageVo.getOffset(), pageVo.getRows());
		pageVo.setList(list);
		pageVo.setCount(this.getAllListCount());
		return pageVo;
	}
	public PageVo<PictureEntity> getAllListPageByClassId(int pageNum, long classId) throws Exception {
		PageVo<PictureEntity> pageVo = new PageVo<PictureEntity>(pageNum);
		List<PictureEntity> list = pictureDao
				.getAllListPageByClassId(pageVo.getOffset(), pageVo.getRows(),classId);
		pageVo.setList(list);
		pageVo.setCount(pictureDao.getAllListCountByClassId(classId));
		return pageVo;
	}
	public List<PictureEntity> getTopPicture(int topCount, String aliasName)
	{
		return pictureDao.getTopPicture(topCount,aliasName);
	}
}
